/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * StatsWindow.java
 *
 * Created on May 6, 2012, 8:45:04 PM
 */

package checkers;

import java.io.FileReader;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.text.DecimalFormat;
import javax.swing.JOptionPane;


/**
 *
 * @author Laura
 */
public class StatsWindow extends javax.swing.JFrame {

    /** Creates new form StatsWindow */
    public StatsWindow() {
        
        parseStatsFile(stats_path);
        initComponents();
        setLocationRelativeTo(null);
    }

    /** this code assumes that the stats file is in the following format:
     *  <#wins_pvp> <#losses_pvp> <#fastest_time_pvp>
     *  <#wins_pvc> <#losses_pvc> <#fastest_time_pvc>
     * */
    private void parseStatsFile(String filePath)
    {
        try
        {
            BufferedReader in = new BufferedReader(new FileReader(filePath));
            String[] fields;
            String statsLine = in.readLine();
            if(statsLine != null)
            {
                fields = statsLine.split(" ");
                pvp_winsval = Integer.parseInt(fields[0]);
                pvp_lossval = Integer.parseInt(fields[1]);
                pvp_timeval = Integer.parseInt(fields[2]);
                pvp_totalval = pvp_winsval + pvp_lossval;
           }

            statsLine = in.readLine();
            if(statsLine != null)
            {
                fields = statsLine.split(" ");
                pvc_winsval = Integer.parseInt(fields[0]);
                pvc_lossval = Integer.parseInt(fields[1]);
                pvc_timeval = Integer.parseInt(fields[2]);
                pvc_totalval = pvc_winsval + pvc_lossval;
           }

            in.close();


        }
        catch (Exception e)
        {
            System.err.println("Error: " + e.getMessage());
        }
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        stats_tabs = new javax.swing.JTabbedPane();
        pvp_stats = new javax.swing.JPanel();
        pvp_wins = new javax.swing.JLabel();
        pvp_losses = new javax.swing.JLabel();
        pvp_time = new javax.swing.JLabel();
        pvp_clear = new javax.swing.JButton();
        pvp_total = new javax.swing.JLabel();
        pvp_numwin = new javax.swing.JLabel();
        pvp_numloss = new javax.swing.JLabel();
        pvp_numtotal = new javax.swing.JLabel();
        pvp_perwin = new javax.swing.JLabel();
        pvp_perloss = new javax.swing.JLabel();
        pvp_fasttime = new javax.swing.JLabel();
        pvc_stats = new javax.swing.JPanel();
        pvc_wins = new javax.swing.JLabel();
        pvc_numloss = new javax.swing.JLabel();
        pvc_numtotal = new javax.swing.JLabel();
        pvc_numwins = new javax.swing.JLabel();
        pvc_perloss = new javax.swing.JLabel();
        pvp_losses1 = new javax.swing.JLabel();
        pvc_total = new javax.swing.JLabel();
        pvc_clear = new javax.swing.JButton();
        pvc_perwin = new javax.swing.JLabel();
        pvc_time = new javax.swing.JLabel();
        pvc_fasttime = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Checkers Statistics");
        setResizable(false);

        stats_tabs.setFont(new java.awt.Font("Britannic Bold", 0, 18)); // NOI18N

        pvp_wins.setIcon(new javax.swing.ImageIcon(getClass().getResource("/checkersGUI/wins.png"))); // NOI18N

        pvp_losses.setIcon(new javax.swing.ImageIcon(getClass().getResource("/checkersGUI/losses.png"))); // NOI18N

        pvp_time.setIcon(new javax.swing.ImageIcon(getClass().getResource("/checkersGUI/time.png"))); // NOI18N

        pvp_clear.setBackground(null);
        pvp_clear.setIcon(new javax.swing.ImageIcon(getClass().getResource("/checkersGUI/clearstats_ico_click.png"))); // NOI18N
        pvp_clear.setBorder(null);
        pvp_clear.setBorderPainted(false);
        pvp_clear.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        pvp_clear.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
        pvp_clear.setIconTextGap(0);
        pvp_clear.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                pvp_clearMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                pvp_clearMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                pvp_clearMouseExited(evt);
            }
        });
        pvp_clear.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                pvp_clearActionPerformed(evt);
            }
        });

        pvp_total.setIcon(new javax.swing.ImageIcon(getClass().getResource("/checkersGUI/total.png"))); // NOI18N

        pvp_numwin.setFont(new java.awt.Font("Britannic Bold", 0, 18)); // NOI18N
        pvp_numwin.setText(Integer.toString(pvp_winsval));

        pvp_numloss.setFont(new java.awt.Font("Britannic Bold", 0, 18)); // NOI18N
        pvp_numloss.setText(Integer.toString(pvp_lossval));

        pvp_numtotal.setFont(new java.awt.Font("Britannic Bold", 0, 18)); // NOI18N
        pvp_numtotal.setText(Integer.toString(pvp_totalval));

        pvp_perwin.setFont(new java.awt.Font("Britannic Bold", 0, 18)); // NOI18N
        pvp_perwin.setText(String.format("%.1f", checkPercent(pvp_winsval, pvp_totalval) * 100) + "%");

        pvp_perloss.setFont(new java.awt.Font("Britannic Bold", 0, 18)); // NOI18N
        pvp_perloss.setText(String.format("%.1f",checkPercent(pvp_lossval, pvp_totalval) * 100) + "%");

        pvp_fasttime.setFont(new java.awt.Font("Britannic Bold", 0, 18)); // NOI18N
        pvp_fasttime.setText(Integer.toString(pvp_timeval) + " Moves");

        javax.swing.GroupLayout pvp_statsLayout = new javax.swing.GroupLayout(pvp_stats);
        pvp_stats.setLayout(pvp_statsLayout);
        pvp_statsLayout.setHorizontalGroup(
            pvp_statsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pvp_statsLayout.createSequentialGroup()
                .addGap(29, 29, 29)
                .addGroup(pvp_statsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pvp_statsLayout.createSequentialGroup()
                        .addGroup(pvp_statsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                            .addComponent(pvp_wins)
                            .addComponent(pvp_numwin)
                            .addComponent(pvp_perwin))
                        .addGap(54, 54, 54)
                        .addGroup(pvp_statsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                            .addComponent(pvp_numloss)
                            .addComponent(pvp_losses)
                            .addComponent(pvp_perloss))
                        .addGap(77, 77, 77)
                        .addGroup(pvp_statsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                            .addComponent(pvp_total)
                            .addComponent(pvp_numtotal)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pvp_statsLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(pvp_statsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pvp_statsLayout.createSequentialGroup()
                                .addGap(414, 414, 414)
                                .addComponent(pvp_clear, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(pvp_statsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                                .addComponent(pvp_fasttime)
                                .addComponent(pvp_time)))
                        .addGap(1, 1, 1)))
                .addContainerGap(44, Short.MAX_VALUE))
        );
        pvp_statsLayout.setVerticalGroup(
            pvp_statsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pvp_statsLayout.createSequentialGroup()
                .addGap(34, 34, 34)
                .addGroup(pvp_statsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pvp_statsLayout.createSequentialGroup()
                        .addComponent(pvp_wins)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(pvp_numwin)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(pvp_perwin))
                    .addGroup(pvp_statsLayout.createSequentialGroup()
                        .addComponent(pvp_losses)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(pvp_numloss, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(pvp_perloss))
                    .addGroup(pvp_statsLayout.createSequentialGroup()
                        .addComponent(pvp_total)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(pvp_numtotal)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 55, Short.MAX_VALUE)
                .addGroup(pvp_statsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(pvp_statsLayout.createSequentialGroup()
                        .addComponent(pvp_time)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(pvp_fasttime))
                    .addComponent(pvp_clear, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(35, 35, 35))
        );

        stats_tabs.addTab("Player v. Player", pvp_stats);

        pvc_wins.setIcon(new javax.swing.ImageIcon(getClass().getResource("/checkersGUI/wins.png"))); // NOI18N

        pvc_numloss.setFont(new java.awt.Font("Britannic Bold", 0, 18)); // NOI18N
        pvc_numloss.setText(Integer.toString(pvc_lossval));

        pvc_numtotal.setFont(new java.awt.Font("Britannic Bold", 0, 18)); // NOI18N
        pvc_numtotal.setText(Integer.toString(pvp_totalval));

        pvc_numwins.setFont(new java.awt.Font("Britannic Bold", 0, 18)); // NOI18N
        pvc_numwins.setText(Integer.toString(pvc_winsval));

        pvc_perloss.setFont(new java.awt.Font("Britannic Bold", 0, 18)); // NOI18N
        pvc_perloss.setText(String.format("%.1f", checkPercent(pvc_lossval, pvc_totalval) * 100) + "%");

        pvp_losses1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/checkersGUI/losses.png"))); // NOI18N

        pvc_total.setIcon(new javax.swing.ImageIcon(getClass().getResource("/checkersGUI/total.png"))); // NOI18N

        pvc_clear.setBackground(null);
        pvc_clear.setIcon(new javax.swing.ImageIcon(getClass().getResource("/checkersGUI/clearstats_ico_click.png"))); // NOI18N
        pvc_clear.setBorder(null);
        pvc_clear.setBorderPainted(false);
        pvc_clear.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        pvc_clear.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
        pvc_clear.setIconTextGap(0);
        pvc_clear.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                pvc_clearMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                pvc_clearMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                pvc_clearMouseExited(evt);
            }
        });
        pvc_clear.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                pvc_clearActionPerformed(evt);
            }
        });

        pvc_perwin.setFont(new java.awt.Font("Britannic Bold", 0, 18)); // NOI18N
        pvc_perwin.setText(String.format("%.1f", checkPercent(pvc_winsval, pvc_totalval) * 100) + "%");

        pvc_time.setIcon(new javax.swing.ImageIcon(getClass().getResource("/checkersGUI/time.png"))); // NOI18N

        pvc_fasttime.setFont(new java.awt.Font("Britannic Bold", 0, 18)); // NOI18N
        pvc_fasttime.setText(Integer.toString(pvp_timeval) + " Moves");

        javax.swing.GroupLayout pvc_statsLayout = new javax.swing.GroupLayout(pvc_stats);
        pvc_stats.setLayout(pvc_statsLayout);
        pvc_statsLayout.setHorizontalGroup(
            pvc_statsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pvc_statsLayout.createSequentialGroup()
                .addGroup(pvc_statsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pvc_statsLayout.createSequentialGroup()
                        .addGap(45, 45, 45)
                        .addGroup(pvc_statsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                            .addComponent(pvc_fasttime)
                            .addComponent(pvc_time)))
                    .addGroup(pvc_statsLayout.createSequentialGroup()
                        .addGap(27, 27, 27)
                        .addGroup(pvc_statsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                            .addComponent(pvc_perwin)
                            .addComponent(pvc_numwins)
                            .addComponent(pvc_wins))
                        .addGap(59, 59, 59)
                        .addGroup(pvc_statsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                            .addComponent(pvc_perloss)
                            .addComponent(pvc_numloss)
                            .addComponent(pvp_losses1))
                        .addGap(71, 71, 71)
                        .addGroup(pvc_statsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                            .addComponent(pvc_numtotal)
                            .addComponent(pvc_total)
                            .addComponent(pvc_clear, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(47, Short.MAX_VALUE))
        );
        pvc_statsLayout.setVerticalGroup(
            pvc_statsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pvc_statsLayout.createSequentialGroup()
                .addGap(33, 33, 33)
                .addGroup(pvc_statsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pvc_statsLayout.createSequentialGroup()
                        .addComponent(pvc_wins)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(pvc_numwins)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(pvc_perwin))
                    .addGroup(pvc_statsLayout.createSequentialGroup()
                        .addComponent(pvp_losses1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(pvc_numloss)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(pvc_perloss))
                    .addGroup(pvc_statsLayout.createSequentialGroup()
                        .addComponent(pvc_total)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(pvc_numtotal)))
                .addGap(56, 56, 56)
                .addGroup(pvc_statsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(pvc_statsLayout.createSequentialGroup()
                        .addComponent(pvc_time)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(pvc_fasttime))
                    .addComponent(pvc_clear, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(35, 35, 35))
        );

        stats_tabs.addTab("Player v. Computer", pvc_stats);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(stats_tabs, javax.swing.GroupLayout.DEFAULT_SIZE, 704, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(stats_tabs, javax.swing.GroupLayout.DEFAULT_SIZE, 306, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void pvp_clearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pvp_clearActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_pvp_clearActionPerformed

    private void pvp_clearMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_pvp_clearMouseEntered
        // TODO add your handling code here:
         pvp_clear.setIcon(new javax.swing.ImageIcon(getClass().getResource("/checkersGUI/clearstats_ico.png")));
    }//GEN-LAST:event_pvp_clearMouseEntered

    private void pvp_clearMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_pvp_clearMouseExited
        // TODO add your handling code here:
         pvp_clear.setIcon(new javax.swing.ImageIcon(getClass().getResource("/checkersGUI/clearstats_ico_click.png")));
    }//GEN-LAST:event_pvp_clearMouseExited

    private void pvc_clearMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_pvc_clearMouseEntered
        // TODO add your handling code here:
        pvc_clear.setIcon(new javax.swing.ImageIcon(getClass().getResource("/checkersGUI/clearstats_ico.png")));
    }//GEN-LAST:event_pvc_clearMouseEntered

    private void pvc_clearMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_pvc_clearMouseExited
        // TODO add your handling code here:
        pvc_clear.setIcon(new javax.swing.ImageIcon(getClass().getResource("/checkersGUI/clearstats_ico_click.png")));
    }//GEN-LAST:event_pvc_clearMouseExited

    private void pvc_clearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pvc_clearActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_pvc_clearActionPerformed

    private void pvp_clearMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_pvp_clearMouseClicked
        // TODO add your handling code here:
        int confirm = JOptionPane.showConfirmDialog(this, "Are you sure you want to clear your statistics?","Confirm", JOptionPane.YES_NO_OPTION);


        if(confirm == JOptionPane.YES_OPTION)
        {
            clearStatsFile(stats_path, PVP);
            updateVals();
        }
    }//GEN-LAST:event_pvp_clearMouseClicked

    private void pvc_clearMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_pvc_clearMouseClicked

       int confirm = JOptionPane.showConfirmDialog(this, "Are you sure you want to clear your statistics?","Confirm", JOptionPane.YES_NO_OPTION);


        if(confirm == JOptionPane.YES_OPTION)
        {
            clearStatsFile(stats_path, PVC);
            updateVals();
        }
    }//GEN-LAST:event_pvc_clearMouseClicked

    private void updateVals()
    {
         pvp_fasttime.setText(Integer.toString(pvp_timeval) + " Moves");
         pvp_numwin.setText(Integer.toString(pvp_winsval));
         pvp_numloss.setText(Integer.toString(pvp_lossval));
         pvp_numtotal.setText(Integer.toString(pvp_totalval));
         pvp_perwin.setText(String.format("%.1f", checkPercent(pvp_winsval, pvp_totalval) * 100) + "%");
         pvp_perloss.setText(String.format("%.1f", checkPercent(pvp_lossval, pvp_totalval) * 100) + "%");

         pvc_fasttime.setText(Integer.toString(pvc_timeval) + " Moves");
         pvc_numwins.setText(Integer.toString(pvc_winsval));
         pvc_numloss.setText(Integer.toString(pvc_lossval));
         pvc_numtotal.setText(Integer.toString(pvc_totalval));
         pvc_perwin.setText(String.format("%.1f", checkPercent(pvc_winsval, pvc_totalval) * 100) + "%");
         pvc_perloss.setText(String.format("%.1f", checkPercent(pvc_lossval, pvc_totalval) * 100) + "%");
    }

    private void clearStatsFile(String filePath, int which)
    {
        try
        {
            BufferedWriter in = new BufferedWriter(new FileWriter(filePath));

            String newPVP;
            String newPVC;

            if(which == PVP)
            {
                newPVP = "0 0 0";
                newPVC = Integer.toString(pvc_winsval) + " " + Integer.toString(pvc_lossval) + " " + Integer.toString(pvc_timeval);
                pvp_winsval = 0;
                pvp_lossval = 0;
                pvp_totalval = 0;
                pvp_timeval = 0;
            }
            else
            {
                newPVC = "0 0 0";
                newPVP = Integer.toString(pvp_winsval) + " " + Integer.toString(pvp_lossval) + " " + Integer.toString(pvp_timeval);
                pvc_winsval = 0;
                pvc_lossval = 0;
                pvc_totalval = 0;
                pvc_timeval = 0;
            }
            
            in.write(newPVP + "\n" + newPVC);
            in.close();
        }
        catch (Exception e)
        {
            System.err.println("Error: " + e.getMessage());
        }
    }

    private double checkPercent(int num, int denom)
    {
        if(denom == 0)
        {
            return 0;
        }
        else
        {
            return (double)num / denom;
        }
    }
    
    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new StatsWindow().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton pvc_clear;
    private javax.swing.JLabel pvc_fasttime;
    private javax.swing.JLabel pvc_numloss;
    private javax.swing.JLabel pvc_numtotal;
    private javax.swing.JLabel pvc_numwins;
    private javax.swing.JLabel pvc_perloss;
    private javax.swing.JLabel pvc_perwin;
    private javax.swing.JPanel pvc_stats;
    private javax.swing.JLabel pvc_time;
    private javax.swing.JLabel pvc_total;
    private javax.swing.JLabel pvc_wins;
    private javax.swing.JButton pvp_clear;
    private javax.swing.JLabel pvp_fasttime;
    private javax.swing.JLabel pvp_losses;
    private javax.swing.JLabel pvp_losses1;
    private javax.swing.JLabel pvp_numloss;
    private javax.swing.JLabel pvp_numtotal;
    private javax.swing.JLabel pvp_numwin;
    private javax.swing.JLabel pvp_perloss;
    private javax.swing.JLabel pvp_perwin;
    private javax.swing.JPanel pvp_stats;
    private javax.swing.JLabel pvp_time;
    private javax.swing.JLabel pvp_total;
    private javax.swing.JLabel pvp_wins;
    private javax.swing.JTabbedPane stats_tabs;
    // End of variables declaration//GEN-END:variables

    private final String stats_path = "src/checkersGUI/stats.txt";
    private int pvp_winsval;
    private int pvp_lossval;
    private int pvp_totalval;
    private int pvp_timeval;
    private int pvc_winsval;
    private int pvc_lossval;
    private int pvc_totalval;
    private int pvc_timeval;

    private final int PVP = 1;
    private final int PVC = 0;

}

